<?
	if(isset($_POST['standard'] )){
		foreach($_POST['standard'] as $k => $v){
			$s['name'] = $v;
			$db->update("assessment_standard", $s, "id=$k");
		}
	}

	if(trim($_POST['name']) != ""){
		$data['name'] = $_POST['name'];
		$data['aid'] = $_POST['id'];

		$db->insert("assessment_standard", $data);
	}

	redirect("assessment.php?id=".$id);
?>